using System;
using System.Collections.Generic;
using System.Text;
using MediaPortal.Configuration;


namespace MTVMusicPlugin
{
  public class Settings
  {

    private string pluginName;

    public string PluginName
    {
      get { return pluginName; }
      set { pluginName = value; }
    }

    private int initial;

    public int InitialDisplay
    {
      get { return initial; }
      set { initial = value; }
    }

    public void Load()
    {
      using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
      {
        this.PluginName = xmlreader.GetValueAsString("mtvmusic", "PluginName", "MTV Music Videos");
        this.InitialDisplay = xmlreader.GetValueAsInt("mtvmusic", "InitialDisplay", 0);
      }
    }

    public void Save()
    {
      using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
      {
        xmlwriter.SetValue("mtvmusic", "PluginName", this.PluginName);
        xmlwriter.SetValue("mtvmusic", "InitialDisplay", this.InitialDisplay);
      }
    }

    public Settings()
    {
      this.PluginName = "MTV Music Videos";
    }
    

  }
}
